package com.thtf.strokeinquiry.app.util;

import java.util.Date;

public class CodeUtil {

    public static  String generationCodeRecordId() {

        String prefixString = "1022";

        String year = DateConvertUtil.covvert2String(new Date(),DateConvertUtil.yearFormatter);
        String date =DateConvertUtil.covvert2String(new Date(),DateConvertUtil.dateFormatter);
        String random = RandomUtil.getRandomByRange(10,99)+"";
        String macNum ="341";
        String seq=System.currentTimeMillis()%1000+"";
        StringBuffer code=new StringBuffer();
        String random2 = RandomUtil.getRandomByRange(10,99)+"";
        code.append(prefixString).append(year).append(random).append(date).append(macNum).append(seq).append(random2);
        return code.toString();
    }

    public static  String generationCodePatientId() {
        String prefixString = "2022";
        String year = DateConvertUtil.covvert2String(new Date(),DateConvertUtil.yearFormatter);
        String date =DateConvertUtil.covvert2String(new Date(),DateConvertUtil.dateFormatter);
        String random = RandomUtil.getRandomByRange(10,99)+"";
        String macNum ="173";
        String seq=System.currentTimeMillis()%1000+"";
        StringBuffer code=new StringBuffer();
        String random2 = RandomUtil.getRandomByRange(10,99)+"";
        code.append(prefixString).append(year).append(random).append(date).append(macNum).append(seq).append(random2);
        return code.toString();
    }



}
